<template>
  <div class="history">
    <div class="history-header flex">
      <DatePicker type="year" placeholder="选择年份" :value="currentYear" style="width: 200px"></DatePicker>
      <Button class="save-btn-green">上传历史工资</Button>
    </div>
    <div class="table-wrap mt12">
      <Table width="100%" :columns="columns1" class="table3" :data="list"></Table>
    </div>
    <Nodata desc="暂无该年历史工资数据"></Nodata>
  </div>
</template>
<script>
import { salary } from "@/apis";
import http from "@/utils/http";
export default {
  data() {
    return {
        currentYear:new Date().getFullYear().toString(),
         columns1: [
        {
          title: "姓名",
          key: "name"
        },
        {
          title: "工号",
          key: "age"
        },
        {
          title: "部门",
          key: "province"
        },
        {
          title: "岗位",
          key: "city"
        },
        {
          title: "工作性质",
          key: "city"
        },
        {
          title: "工时制类型",
          key: "city"
        },
        {
          title: "月计薪时长",
          key: "city"
        },
        {
          title: "实际计薪时长",
          key: "city"
        },
      ],
      list:[],
    };
  },
  methods: {
    getList() {
      http.get(salary.salaryhistorylist, {}).then(res => {
        if (res.e == "9999") {
         this.list = res.data.list.data || [];
        } else {
          this.$Message.error(res.m);
        }
      });
    }
  },
  mounted() {
    this.getList();
  }
};
</script>
<style lang="scss" scoped src='../index.scss'>
</style>